home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Arsenal / OS2 Arsenal v1.0 (Disc 1)(Arsenal Computer).ISO / os2_inet / tcp20c4.exe / BPUBSC1.ZIP / DOC / rxftp.inf (.txt) < prev    next >
OS/2 Help File  |  1994-04-12  |  33KB  |  1,251 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
  3.  
  4. The REXX File Transfer Protocol (FTP) Application Program Interface (API) 
  5. package provides access to the OS/2 TCP/IP FTP API's.  It is assumed you are 
  6. familiar with the basic FTP.  The REXX FTP API function names are similar to 
  7. the FTP subcommands. 
  8.  
  9. References 
  10.  
  11. For information on the FTP subcommands, refer to the IBM Transmission Control 
  12. Protocol/Internet Protocol Version 2.0 for OS/2: User's Guide. 
  13.  
  14. For information on FTP API calls, refer to the IBM Transmission Control 
  15. Protocol/Internet Protocol Version 2.0 for OS/2:  Programmer's Reference. 
  16.  
  17. Requirements 
  18.  
  19. The REXX FTP API package requires the OS/2 TCP/IP product, version 2.0 or 
  20. higher. 
  21.  
  22. The REXX feature from the OS/2 Setup and Installation window must be installed. 
  23. To access the REXX feature, choose Selective Install from the OS/2 System Setup 
  24. folder.  Then from the System Configuration window, select OK to display the 
  25. OS/2 Setup and Installation window. Check the REXX feature and select the 
  26. Install push button. 
  27.  
  28.  
  29. ΓòÉΓòÉΓòÉ 2. Installation ΓòÉΓòÉΓòÉ
  30.  
  31. The REXX FTP API package is contained in the file rxftp.dll.  This dynamic link 
  32. library (DLL) needs to be placed in a directory listed in your LIBPATH 
  33. statement in your CONFIG.SYS file.  To get access to the functions in the REXX 
  34. FTP API package, execute the following REXX code: 
  35.  
  36. rc = RxFuncAdd("FTPLoadFuncs","rxFtp","FTPLoadFuncs")
  37. rc = FtpLoadFuncs()
  38.  
  39. To unload the DLL, you should first call the FtpDropFuncs() function, then exit 
  40. all CMD.EXE shells.  After exiting all the command shells, the DLL will be 
  41. dropped by OS/2 and can be deleted or replaced. 
  42.  
  43.  
  44. ΓòÉΓòÉΓòÉ 3. Return Values ΓòÉΓòÉΓòÉ
  45.  
  46. Select an item: 
  47.  
  48. Set errors
  49.  FtpSetUser()
  50.  FtpSetBinary()
  51.  
  52. FTP errors
  53.  All other functions
  54.  
  55.  
  56. ΓòÉΓòÉΓòÉ <hidden> Set Error Codes ΓòÉΓòÉΓòÉ
  57.  
  58. The FtpSetUser() and FtpSetBinary() functions return the Set error codes: 
  59.  
  60. 1 is the return code if the string passed is valid. 
  61.  
  62. 0 is the return code if the string is not valid. 
  63.  
  64.  
  65. ΓòÉΓòÉΓòÉ <hidden> FTP Error Codes ΓòÉΓòÉΓòÉ
  66.  
  67. All of the REXX FTP API functions, except FtpSetUser() and FtpSetBinary(), 
  68. return the FTP error codes: 
  69.  
  70. The FTP error codes will have one of the following values: 
  71.  
  72. "0" for a successful call 
  73.  
  74. "-1" if there is an error during FTP function call 
  75.  
  76. If the function returns a "-1" for an error code, the variable FTPERRNO will be 
  77. set to one of the following values (or a numeric value if the number is not one 
  78. of these values): 
  79.  
  80. "FTPSERVICE" 
  81.      unknown service 
  82. "FTPHOST" 
  83.      unknown host 
  84. "FTPSOCKET" 
  85.      unable to obtain socket 
  86. "FTPCONNECT" 
  87.      unable to connect to server 
  88. "FTPLOGIN" 
  89.      login failed 
  90. "FTPABORT" 
  91.      transfer stopped 
  92. "FTPLOCALFILE" 
  93.      problem opening local file 
  94. "FTPDATACONN" 
  95.      problem initializing data connection 
  96. "FTPCOMMAND" 
  97.      command failed 
  98. "FTPPROXYTHIRD" 
  99.      proxy server does not support third party transfers 
  100. "FTPNOPRIMARY" 
  101.      no primary connection for proxy transfer 
  102.  
  103.  
  104. ΓòÉΓòÉΓòÉ 4. Functions ΓòÉΓòÉΓòÉ
  105.  
  106. Most of the REXX FTP API functions correspond to their like-named FTP 
  107. subcommands. 
  108.  
  109. Opening and Closing Functions 
  110.  
  111. FtpLoadFuncs()      FtpDropFuncs()      FtpVersion()
  112. FtpSetUser()        FtpSetBinary()      FtpLogoff()
  113.  
  114. File Action Functions 
  115.  
  116. FtpAppend()         FtpDelete()         FtpRename()
  117. FtpGet()            FtpPut()            FtpPutUnique()
  118.  
  119. Directory Listing Functions 
  120.  
  121. FtpLs()             FtpDir()
  122.  
  123. Directory Action Functions 
  124.  
  125. FtpChDir()          FtpMkDir()          FtpRmDir()
  126. FtpPwd()
  127.  
  128. Remote Server Functions 
  129.  
  130. FtpQuote()          FtpSite()           FtpSys()
  131. FtpProxy()          FtpPing()
  132.  
  133.  
  134. ΓòÉΓòÉΓòÉ <hidden> Open/Close ΓòÉΓòÉΓòÉ
  135.  
  136.  FtpLoadFuncs() 
  137.  FtpDropFuncs() 
  138.  FtpVersion() 
  139.  FtpSetUser() 
  140.  FtpSetBinary() 
  141.  FtpLogoff() 
  142.  Calls by Task 
  143.  
  144.  
  145. ΓòÉΓòÉΓòÉ <hidden> File Actions ΓòÉΓòÉΓòÉ
  146.  
  147.  FtpGet() 
  148.  FtpPut() 
  149.  FtpPutUnique() 
  150.  FtpAppend() 
  151.  FtpDelete() 
  152.  FtpRename() 
  153.  Calls by Task 
  154.  
  155.  
  156. ΓòÉΓòÉΓòÉ <hidden> Directory List ΓòÉΓòÉΓòÉ
  157.  
  158.  FtpLs() 
  159.  FtpDir() 
  160.  Calls by Task 
  161.  
  162.  
  163. ΓòÉΓòÉΓòÉ <hidden> Directory Actions ΓòÉΓòÉΓòÉ
  164.  
  165.  FtpChDir() 
  166.  FtpMkDir() 
  167.  FtpRmDir() 
  168.  FtpPwd() 
  169.  Calls by Task 
  170.  
  171.  
  172. ΓòÉΓòÉΓòÉ <hidden> Remote Servers ΓòÉΓòÉΓòÉ
  173.  
  174.  FtpQuote() 
  175.  FtpSite() 
  176.  FtpSys() 
  177.  FtpProxy() 
  178.  FtpPing() 
  179.  Calls by Task 
  180.  
  181.  
  182. ΓòÉΓòÉΓòÉ 4.1. FtpAppend() ΓòÉΓòÉΓòÉ
  183.  
  184. Select an item: 
  185.  
  186.  Syntax 
  187.  Parameters 
  188.  Return Values 
  189.  Definition 
  190.  Related Calls 
  191.  
  192.  
  193. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpAppend() ΓòÉΓòÉΓòÉ
  194.  
  195. /* Copies a file from the local host to
  196.    a remote host and adds the local file
  197.    to the end of the file on the remote
  198.    host                               */
  199.  
  200. rc = FtpAppend(localFile,remoteFile<,"Binary"|"Ascii">)
  201.  
  202.  
  203. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpAppend() ΓòÉΓòÉΓòÉ
  204.  
  205. The FtpAppend() call copies a local file to a remote host and adds the local 
  206. file to the end of the file on the remote host.  As an option, you can specify 
  207. the transfer to occur in binary mode or text (ASCII) mode. 
  208.  
  209. If a you do not specify the transfer mode with this call, the mode specified 
  210. with the FtpSetBinary() call is used. 
  211.  
  212. The remote host is specified with the FtpSetUser() call. 
  213.  
  214.  
  215. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpAppend() ΓòÉΓòÉΓòÉ
  216.  
  217. localFile 
  218.    name of the file to be copied from the local host. 
  219.  
  220. remoteFile 
  221.    name of the file on the remote host to which the local file is added to. 
  222.  
  223. "Binary" 
  224.    sets the file transfer mode to binary or image. 
  225.  
  226. "Ascii" 
  227.    sets the file transfer type to ASCII (flat text). 
  228.  
  229.  
  230. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpAppend() ΓòÉΓòÉΓòÉ
  231.  
  232. FTP error codes 
  233.  
  234.  
  235. ΓòÉΓòÉΓòÉ 4.2. FtpChDir() ΓòÉΓòÉΓòÉ
  236.  
  237. Select an item: 
  238.  
  239.  Syntax 
  240.  Parameters 
  241.  Return Values 
  242.  Definition 
  243.  Related Calls 
  244.  
  245.  
  246. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpChDir() ΓòÉΓòÉΓòÉ
  247.  
  248. /* Changes the working directory on the
  249.    remote host                       */
  250.  
  251. rc = FtpChDir(directory)
  252.  
  253.  
  254. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpChDir() ΓòÉΓòÉΓòÉ
  255.  
  256. The FtpChDir() call changes the working directory on the remote host. 
  257.  
  258. The remote host is specified with the FtpSetUser() call. 
  259.  
  260.  
  261. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpChDir() ΓòÉΓòÉΓòÉ
  262.  
  263. directory 
  264.    change to this directory name on the remote host. 
  265.  
  266.  
  267. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpChDir() ΓòÉΓòÉΓòÉ
  268.  
  269. FTP error codes 
  270.  
  271.  
  272. ΓòÉΓòÉΓòÉ 4.3. FtpDelete() ΓòÉΓòÉΓòÉ
  273.  
  274. Select an item: 
  275.  
  276.  Syntax 
  277.  Parameters 
  278.  Return Values 
  279.  Definition 
  280.  Related Calls 
  281.  
  282.  
  283. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpDelete() ΓòÉΓòÉΓòÉ
  284.  
  285. /* Deletes a single file on the
  286.    remote host                 */
  287.  
  288. rc = FtpDelete(remoteFile)
  289.  
  290.  
  291. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpDelete() ΓòÉΓòÉΓòÉ
  292.  
  293. The FtpDelete() call deletes a single file on a remote host. 
  294.  
  295. The remote host is specified with the FtpSetUser() call. 
  296.  
  297.  
  298. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpDelete() ΓòÉΓòÉΓòÉ
  299.  
  300. remoteFile 
  301.    name of the file on the remote host which will be deleted. 
  302.  
  303.  
  304. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpDelete() ΓòÉΓòÉΓòÉ
  305.  
  306. FTP error codes 
  307.  
  308.  
  309. ΓòÉΓòÉΓòÉ 4.4. FtpDir() ΓòÉΓòÉΓòÉ
  310.  
  311. Select an item: 
  312.  
  313.  Syntax 
  314.  Parameters 
  315.  Return Values 
  316.  Definition 
  317.  Related Calls 
  318.  
  319.  
  320. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpDir() ΓòÉΓòÉΓòÉ
  321.  
  322. /* Gets the directory information for
  323.    the current directory of the remote
  324.    host                              */
  325.  
  326. rc = FtpDir(pattern,stem)
  327.  
  328.  
  329. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpDir() ΓòÉΓòÉΓòÉ
  330.  
  331. The FtpDir() call gets the directory information for the current directory of 
  332. the remote host.  The FtpDir() call gets the directory information in long 
  333. format.  The directory information is placed into the stemmed variables. 
  334.  
  335. The remote host is specified with the FtpSetUser() call. 
  336.  
  337. The FtpDir() call is similar to the FtpLs() call, except that the FtpLs() call 
  338. gets the directory information in short format. 
  339.  
  340.  
  341. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpDir() ΓòÉΓòÉΓòÉ
  342.  
  343. pattern 
  344.    file name or pattern of the files to be listed on the remote host. Patterns 
  345.    are any combination of ASCII characters.  The following two characters have 
  346.    special meanings: 
  347.  
  348.    *    shows that any character or group of characters can occupy that 
  349.         position in the pattern. 
  350.    ?    shows that any single character can occupy that position in the 
  351.         pattern. 
  352.  
  353. stem 
  354.    specifies the variable stem.  The stem string should end with a period 
  355.    ("."). 
  356.  
  357.    When the function completes, the variable stem || "0" will be set to the 
  358.    number of stem variables returned.  The directory information is set in 
  359.    variables stem || "1", stem || "2", etc. The "." is not appended, so you 
  360.    should specify it in the stem name passed to the function.  For example, the 
  361.    following call: 
  362.  
  363.       rc=FtpDir("ftpx*.c","files.")
  364.  
  365.    located 3 files in the current directory of the remote host.  The stemmed 
  366.    variables are: 
  367.  
  368.       Variable       Value
  369.       files.0        3
  370.       files.1        ftpxdir.c
  371.       files.2        ftpxren.c
  372.       files.3        ftpxdel.c
  373.  
  374.  
  375. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpDir() ΓòÉΓòÉΓòÉ
  376.  
  377. FTP error codes 
  378.  
  379.  
  380. ΓòÉΓòÉΓòÉ 4.5. FtpDropFuncs() ΓòÉΓòÉΓòÉ
  381.  
  382. Select an item: 
  383.  
  384.  Syntax 
  385.  Parameters 
  386.  Return Values 
  387.  Definition 
  388.  Related Calls 
  389.  
  390.  
  391. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpDropFuncs() ΓòÉΓòÉΓòÉ
  392.  
  393. /* Drops all functions in the REXX
  394.    FTP API package                */
  395.  
  396. rc = FtpDropFuncs()
  397.  
  398.  
  399. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpDropFuncs() ΓòÉΓòÉΓòÉ
  400.  
  401. The FtpDropFuncs() call drops all the functions in the REXX FTP API package. 
  402.  
  403.  
  404. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpDropFuncs() ΓòÉΓòÉΓòÉ
  405.  
  406. none 
  407.  
  408.  
  409. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpDropFuncs() ΓòÉΓòÉΓòÉ
  410.  
  411. FTP error codes 
  412.  
  413.  
  414. ΓòÉΓòÉΓòÉ 4.6. FtpGet() ΓòÉΓòÉΓòÉ
  415.  
  416. Select an item: 
  417.  
  418.  Syntax 
  419.  Parameters 
  420.  Return Values 
  421.  Definition 
  422.  Related Calls 
  423.  
  424.  
  425. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpGet() ΓòÉΓòÉΓòÉ
  426.  
  427. /* Copies a single file from a remote
  428.    host to your workstation          */
  429.  
  430. rc = FtpGet(localFile,remoteFile<,"Binary"|"Ascii">)
  431.  
  432.  
  433. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpGet() ΓòÉΓòÉΓòÉ
  434.  
  435. The FtpGet() call copies a single file from the remote host to the local 
  436. workstation.  The remote file name does not have to be the same as the local 
  437. file name.  As an option, you can specify the transfer to occur in binary mode 
  438. or text (ASCII) mode. 
  439.  
  440. If a you do not specify the transfer mode with this call, the mode specified 
  441. with the FtpSetBinary() call is used. 
  442.  
  443. The remote host is specified with the FtpSetUser() call. 
  444.  
  445.  
  446. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpGet() ΓòÉΓòÉΓòÉ
  447.  
  448. localFile 
  449.    name of the file on the local host that was copied from the remote host. 
  450.  
  451. remoteFile 
  452.    name of the file on the remote host that was copied to the local 
  453.    workstation. 
  454.  
  455. "Binary" 
  456.    sets the file transfer mode to binary or image. 
  457.  
  458. "Ascii" 
  459.    sets the file transfer type to ASCII (flat text). 
  460.  
  461.  
  462. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpGet() ΓòÉΓòÉΓòÉ
  463.  
  464. FTP error codes 
  465.  
  466.  
  467. ΓòÉΓòÉΓòÉ 4.7. FtpLoadFuncs() ΓòÉΓòÉΓòÉ
  468.  
  469. Select an item: 
  470.  
  471.  Syntax 
  472.  Parameters 
  473.  Return Values 
  474.  Definition 
  475.  Related Calls 
  476.  
  477.  
  478. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpLoadFuncs() ΓòÉΓòÉΓòÉ
  479.  
  480. /* Loads all functions in the REXX
  481.    FTP API package                */
  482.  
  483. rc = FtpLoadFuncs()
  484.  
  485.  
  486. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpLoadFuncs() ΓòÉΓòÉΓòÉ
  487.  
  488. The FtpLoadFuncs() call loads all the functions in the REXX FTP API package. 
  489.  
  490.  
  491. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpLoadFuncs() ΓòÉΓòÉΓòÉ
  492.  
  493. FtpLoadFuncs() - If any parameters are passed to this function, it will bypass 
  494. the copyright information that is normally displayed. 
  495.  
  496. All parameters are ignored (except to determine whether or not to bypass 
  497. displaying the information). 
  498.  
  499.  
  500. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpLoadFuncs() ΓòÉΓòÉΓòÉ
  501.  
  502. FTP error codes 
  503.  
  504.  
  505. ΓòÉΓòÉΓòÉ 4.8. FtpLogoff() ΓòÉΓòÉΓòÉ
  506.  
  507. Select an item: 
  508.  
  509.  Syntax 
  510.  Parameters 
  511.  Return Values 
  512.  Definition 
  513.  Related Calls 
  514.  
  515.  
  516. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpLogoff() ΓòÉΓòÉΓòÉ
  517.  
  518. /* Ends all FTP sessions with the
  519.    remote host                     */
  520.  
  521. rc = FtpLogoff()
  522.  
  523.  
  524. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpLogoff() ΓòÉΓòÉΓòÉ
  525.  
  526. The FtpLogoff() call ends all FTP sessions with the remote host. The host, user 
  527. ID, password, and account will be reset after the FtpLogoff() call. 
  528.  
  529. The remote host is specified with the FtpSetUser() call. 
  530.  
  531.  
  532. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpLogoff() ΓòÉΓòÉΓòÉ
  533.  
  534. none 
  535.  
  536.  
  537. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpLogoff() ΓòÉΓòÉΓòÉ
  538.  
  539. FTP error codes 
  540.  
  541.  
  542. ΓòÉΓòÉΓòÉ 4.9. FtpLs() ΓòÉΓòÉΓòÉ
  543.  
  544. Select an item: 
  545.  
  546.  Syntax 
  547.  Parameters 
  548.  Return Values 
  549.  Definition 
  550.  Related Calls 
  551.  
  552.  
  553. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpLs() ΓòÉΓòÉΓòÉ
  554.  
  555. /* Gets the directory information for
  556.    the current directory of the remote
  557.     host                             */
  558.  
  559. rc = FtpLs(pattern,stem)
  560.  
  561.  
  562. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpLs() ΓòÉΓòÉΓòÉ
  563.  
  564. The FtpLs() call gets the directory information for the current directory of 
  565. the remote host.  The FtpLs() call gets the directory information in short 
  566. format.  The directory information is placed into the stemmed variables. 
  567.  
  568. The remote host is specified with the FtpSetUser() call. 
  569.  
  570. The FtpLs() call is similar to the FtpDir() call, except that the FtpDir() call 
  571. gets the directory information in long format. 
  572.  
  573.  
  574. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpLs() ΓòÉΓòÉΓòÉ
  575.  
  576. pattern 
  577.    file name or pattern of the files to be listed on the remote host. Patterns 
  578.    are any combination of ASCII characters.  The following two characters have 
  579.    special meanings: 
  580.  
  581.    *    shows that any character or group of characters can occupy that 
  582.         position in the pattern. 
  583.    ?    shows that any single character can occupy that position in the 
  584.         pattern. 
  585.  
  586. stem 
  587.    specifies the variable stem.  The stem string should end with a period 
  588.    ("."). 
  589.  
  590.    When the function completes, the variable stem || "0" will be set to the 
  591.    number of stem variables returned.  The directory information is set in 
  592.    variables stem || "1", stem || "2", etc. The "." is not appended, so you 
  593.    should specify it in the stem name passed to the function.  For example, the 
  594.    following call: 
  595.  
  596.       rc=FtpLs("ftpx*.c","files.")
  597.  
  598.    located 3 files in the current directory of the remote host.  The stemmed 
  599.    variables are: 
  600.  
  601.       Variable       Value
  602.       files.0        3
  603.       files.1        ftpxdir.c
  604.       files.2        ftpxren.c
  605.       files.3        ftpxdel.c
  606.  
  607.  
  608. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpLs() ΓòÉΓòÉΓòÉ
  609.  
  610. FTP error codes 
  611.  
  612.  
  613. ΓòÉΓòÉΓòÉ 4.10. FtpMkDir() ΓòÉΓòÉΓòÉ
  614.  
  615. Select an item: 
  616.  
  617.  Syntax 
  618.  Parameters 
  619.  Return Values 
  620.  Definition 
  621.  Related Calls 
  622.  
  623.  
  624. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpMkDir() ΓòÉΓòÉΓòÉ
  625.  
  626. /* Makes a new directory on the remote
  627.    host                              */
  628.  
  629. rc = FtpMkDir(directory)
  630.  
  631.  
  632. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpMkDir() ΓòÉΓòÉΓòÉ
  633.  
  634. The FtpMkDir() call makes a new directory on the remote host. 
  635.  
  636. The remote host is specified with the FtpSetUser() call. 
  637.  
  638.  
  639. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpMkDir() ΓòÉΓòÉΓòÉ
  640.  
  641. directory 
  642.    make this directory name on the remote host. 
  643.  
  644.  
  645. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpMkDir() ΓòÉΓòÉΓòÉ
  646.  
  647. FTP error codes 
  648.  
  649.  
  650. ΓòÉΓòÉΓòÉ 4.11. FtpPing() ΓòÉΓòÉΓòÉ
  651.  
  652. Select an item: 
  653.  
  654.  Syntax 
  655.  Parameters 
  656.  Return Values 
  657.  Definition 
  658.  Related Calls 
  659.  
  660.  
  661. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpPing() ΓòÉΓòÉΓòÉ
  662.  
  663. /* Sends a ping to a remote host     */
  664.  
  665. rc = FtpPing(host,length)
  666.  
  667.  
  668. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpPing() ΓòÉΓòÉΓòÉ
  669.  
  670. The FtpPing() call sends a ping to the remote host.  The FtpPing() call tries 
  671. to resolve the host name through a name server.  If a name server is not 
  672. present, FtpPing() call searches the TCPIP\ETC\HOSTS file for a matching host 
  673. name. 
  674.  
  675.  
  676. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpPing() ΓòÉΓòÉΓòÉ
  677.  
  678. host 
  679.    identifies the name for the remote host. 
  680.  
  681. length 
  682.    identifies the length of the ping packets. 
  683.  
  684.  
  685. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpPing() ΓòÉΓòÉΓòÉ
  686.  
  687. If no error occurred, FtpPing() call returns the number of milliseconds it took 
  688. for the echo to return. 
  689.  
  690. If an error occurred, refer to the FTP error codes. 
  691.  
  692.  
  693. ΓòÉΓòÉΓòÉ 4.12. FtpProxy() ΓòÉΓòÉΓòÉ
  694.  
  695. Select an item: 
  696.  
  697.  Syntax 
  698.  Parameters 
  699.  Return Values 
  700.  Definition 
  701.  Related Calls 
  702.  
  703.  
  704. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpProxy() ΓòÉΓòÉΓòÉ
  705.  
  706. /* Copies a file between two remote
  707.    servers                          */
  708.  
  709. rc = FtpProxy(host1,userid1,password1,account1,
  710.               host2,userid2,password2,account2,
  711.               file1,file2<,"Binary"|"Ascii">)
  712.  
  713.  
  714. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpProxy() ΓòÉΓòÉΓòÉ
  715.  
  716. The FtpProxy() call copies a file from one remote host to another remote host. 
  717. You can use different file names on each host. 
  718.  
  719. The "target" host, user ID, password, and account are listed before the "copy 
  720. from" host, user ID, password, and account. 
  721.  
  722. The transfer mode, Binary or ASCII, is optional. 
  723.  
  724.  
  725. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpProxy() ΓòÉΓòÉΓòÉ
  726.  
  727. host1 
  728.    identifies the "target" remote host. 
  729.  
  730. userid1 
  731.    identifies the user on the "target" remote host. 
  732.  
  733. password1 
  734.    supplies the password on the "target" remote host. 
  735.  
  736. account1 
  737.    supplies host-dependent account information on the "target" remote host. 
  738.    Use "NULL" if there is no account value. 
  739.  
  740. host2 
  741.    identifies the "copy from" remote host. 
  742.  
  743. userid2 
  744.    identifies the user on the "copy from" remote host. 
  745.  
  746. password2 
  747.    supplies the password on the "copy from" remote host. 
  748.  
  749. account2 
  750.    supplies host-dependent account information on the "copy from" remote host. 
  751.    Use "NULL" if there is no account value. 
  752.  
  753. file1 
  754.    identifies the files name on the "target" remote host. 
  755.  
  756. file2 
  757.    identifies the files name on the "copy from" remote host. 
  758.  
  759. "Binary" 
  760.    sets the file transfer mode to binary or image. 
  761.  
  762. "Ascii" 
  763.    sets the file transfer type to ASCII (flat text). 
  764.  
  765.  
  766. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpProxy() ΓòÉΓòÉΓòÉ
  767.  
  768. "0 " for a successful call 
  769.  
  770. "-1" if there is an error during the FtpProxy() call 
  771.  
  772. FTP error codes 
  773.  
  774.  
  775. ΓòÉΓòÉΓòÉ 4.13. FtpPut() ΓòÉΓòÉΓòÉ
  776.  
  777. Select an item: 
  778.  
  779.  Syntax 
  780.  Parameters 
  781.  Return Values 
  782.  Definition 
  783.  Related Calls 
  784.  
  785.  
  786. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpPut() ΓòÉΓòÉΓòÉ
  787.  
  788. /* Copies a single file from your
  789.    workstation to a remote host  */
  790.  
  791. rc = FtpPut(localFile,remoteFile<,"Binary"|"Ascii">)
  792.  
  793.  
  794. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpPut() ΓòÉΓòÉΓòÉ
  795.  
  796. The FtpPut() call copies a single file from your workstation to a remote host. 
  797. The local file name does not have to be the same as the remote file name.  As 
  798. an option, you can specify the transfer to occur in binary mode or text (ASCII) 
  799. mode. 
  800.  
  801. If a you do not specify the transfer mode with this call, the mode specified 
  802. with the FtpSetBinary() call is used. 
  803.  
  804. The remote host is specified with the FtpSetUser() call. 
  805.  
  806.  
  807. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpPut() ΓòÉΓòÉΓòÉ
  808.  
  809. localFile 
  810.    name of the file on the local host that was copied to the remote host. 
  811.  
  812. remoteFile 
  813.    name of the file on the remote host that was copied from the local 
  814.    workstation. 
  815.  
  816. "Binary" 
  817.    sets the file transfer mode to binary or image. 
  818.  
  819. "Ascii" 
  820.    sets the file transfer type to ASCII (flat text). 
  821.  
  822.  
  823. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpPut() ΓòÉΓòÉΓòÉ
  824.  
  825. FTP error codes 
  826.  
  827.  
  828. ΓòÉΓòÉΓòÉ 4.14. FtpPutUnique() ΓòÉΓòÉΓòÉ
  829.  
  830. Select an item: 
  831.  
  832.  Syntax 
  833.  Parameters 
  834.  Return Values 
  835.  Definition 
  836.  Related Calls 
  837.  
  838.  
  839. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpPutUnique() ΓòÉΓòÉΓòÉ
  840.  
  841. /* Copies a single file from your
  842.    workstation to a remote host.
  843.    Ensures the file name is unique
  844.    on the remote host.             */
  845.  
  846. rc = FtpPutUnique(localFile,remoteFile<,"Binary"|"Ascii">)
  847.  
  848.  
  849. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpPutUnique() ΓòÉΓòÉΓòÉ
  850.  
  851. The FtpPutUnique() call copies a single file from your workstation to a remote 
  852. host.  The file name on the remote host must be unique. Therefore, files on the 
  853. remote host are not overwritten by files from your workstation. 
  854.  
  855. The local file name does not have to be the same as the remote file name.  As 
  856. an option, you can specify the transfer to occur in binary mode or text (ASCII) 
  857. mode. 
  858.  
  859. If a you do not specify the transfer mode with this call, the mode specified 
  860. with the FtpSetBinary() call is used. 
  861.  
  862. The remote host is specified with the FtpSetUser() call. 
  863.  
  864.  
  865. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpPutUnique() ΓòÉΓòÉΓòÉ
  866.  
  867. localFile 
  868.    name of the file on the local host that was copied to the remote host. 
  869.  
  870. remoteFile 
  871.    name of the file on the remote host that was copied from the local 
  872.    workstation. 
  873.  
  874. "Binary" 
  875.    sets the file transfer mode to binary or image. 
  876.  
  877. "Ascii" 
  878.    sets the file transfer type to ASCII (flat text). 
  879.  
  880.  
  881. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpPutUnique() ΓòÉΓòÉΓòÉ
  882.  
  883. FTP error codes 
  884.  
  885.  
  886. ΓòÉΓòÉΓòÉ 4.15. FtpPwd() ΓòÉΓòÉΓòÉ
  887.  
  888. Select an item: 
  889.  
  890.  Syntax 
  891.  Parameters 
  892.  Return Values 
  893.  Definition 
  894.  Related Calls 
  895.  
  896.  
  897. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpPwd() ΓòÉΓòÉΓòÉ
  898.  
  899. /* Gets the current directory for the
  900.    remote host                     */
  901.  
  902. rc = FtpPwd(dirName)
  903.  
  904.  
  905. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpPwd() ΓòÉΓòÉΓòÉ
  906.  
  907. The FtpPwd() call (print working directory) gets the name of the current 
  908. working directory of the remote host and places the current working directory 
  909. in the variable "dirName". 
  910.  
  911. The remote host is specified with the FtpSetUser() call. 
  912.  
  913.  
  914. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpPwd() ΓòÉΓòÉΓòÉ
  915.  
  916. dirName 
  917.    returns the current working directory of the remote host. 
  918.  
  919.  
  920. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpPwd() ΓòÉΓòÉΓòÉ
  921.  
  922. FTP error codes 
  923.  
  924.  
  925. ΓòÉΓòÉΓòÉ 4.16. FtpQuote() ΓòÉΓòÉΓòÉ
  926.  
  927. Select an item: 
  928.  
  929.  Syntax 
  930.  Parameters 
  931.  Return Values 
  932.  Definition 
  933.  Related Calls 
  934.  
  935.  
  936. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpQuote() ΓòÉΓòÉΓòÉ
  937.  
  938. /* Sends a string to a remote server */
  939.  
  940. rc = FtpQuote(quote)
  941.  
  942.  
  943. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpQuote() ΓòÉΓòÉΓòÉ
  944.  
  945. The FtpQuote() call sends the specified string verbatim to the remote host. 
  946. Your server must support the FTP commands sent by the FtpQuote() call. 
  947.  
  948. The remote host is specified with the FtpSetUser() call. 
  949.  
  950.  
  951. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpQuote() ΓòÉΓòÉΓòÉ
  952.  
  953. quote 
  954.    the string that is sent verbatim to the remote server. 
  955.  
  956.  
  957. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpQuote() ΓòÉΓòÉΓòÉ
  958.  
  959. FTP error codes 
  960.  
  961.  
  962. ΓòÉΓòÉΓòÉ 4.17. FtpRename() ΓòÉΓòÉΓòÉ
  963.  
  964. Select an item: 
  965.  
  966.  Syntax 
  967.  Parameters 
  968.  Return Values 
  969.  Definition 
  970.  Related Calls 
  971.  
  972.  
  973. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpRename() ΓòÉΓòÉΓòÉ
  974.  
  975. /* Renames a single file on the
  976.    remote host                     */
  977.  
  978. rc = FtpRename(oldFile,newFile)
  979.  
  980.  
  981. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpRename() ΓòÉΓòÉΓòÉ
  982.  
  983. The FtpRename() call changes the name of a file on the remote host. 
  984.  
  985. The remote host is specified with the FtpSetUser() call. 
  986.  
  987.  
  988. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpRename() ΓòÉΓòÉΓòÉ
  989.  
  990. oldFile 
  991.    original name of the file on the remote host. 
  992.  
  993. newFile 
  994.    new name of the file on the remote host. 
  995.  
  996.  
  997. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpRename() ΓòÉΓòÉΓòÉ
  998.  
  999. FTP error codes 
  1000.  
  1001.  
  1002. ΓòÉΓòÉΓòÉ 4.18. FtpRmDir() ΓòÉΓòÉΓòÉ
  1003.  
  1004. Select an item: 
  1005.  
  1006.  Syntax 
  1007.  Parameters 
  1008.  Return Values 
  1009.  Definition 
  1010.  Related Calls 
  1011.  
  1012.  
  1013. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpRmDir() ΓòÉΓòÉΓòÉ
  1014.  
  1015. /* Removes a directory on the remote
  1016.    host                              */
  1017.  
  1018. rc = FtpRmDir(directory)
  1019.  
  1020.  
  1021. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpRmDir() ΓòÉΓòÉΓòÉ
  1022.  
  1023. The FtpRmDir() call removes a directory on the remote host. 
  1024.  
  1025. The remote host is specified with the FtpSetUser() call. 
  1026.  
  1027.  
  1028. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpRmDir() ΓòÉΓòÉΓòÉ
  1029.  
  1030. directory 
  1031.    removes this directory name on the remote host. 
  1032.  
  1033.  
  1034. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpRmDir() ΓòÉΓòÉΓòÉ
  1035.  
  1036. FTP error codes 
  1037.  
  1038.  
  1039. ΓòÉΓòÉΓòÉ 4.19. FtpSetBinary() ΓòÉΓòÉΓòÉ
  1040.  
  1041. Select an item: 
  1042.  
  1043.  Syntax 
  1044.  Parameters 
  1045.  Return Values 
  1046.  Definition 
  1047.  Related Calls 
  1048.  
  1049.  
  1050. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpSetBinary() ΓòÉΓòÉΓòÉ
  1051.  
  1052. /* Identifies the default text
  1053.    translation mode as binary or
  1054.    ASCII                         */
  1055.  
  1056. rc = FtpSetBinary("Binary"|"Ascii")
  1057.  
  1058.  
  1059. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpSetBinary() ΓòÉΓòÉΓòÉ
  1060.  
  1061. The FtpSetBinary() call sets the default text translation mode to binary or 
  1062. ASCII for functions that can use this.  You can override this Binary or Ascii 
  1063. setting by any function that takes "Binary"|"Ascii" as an optional parameter. 
  1064.  
  1065. The FtpSetBinary() call can be passed as an abbreviation.  For "BINARY", you 
  1066. can use "b" or "BIN".  For "ASCII", you can use "as". 
  1067.  
  1068.  
  1069. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpSetBinary() ΓòÉΓòÉΓòÉ
  1070.  
  1071. "Binary" 
  1072.    sets the file transfer mode to binary or image. 
  1073.  
  1074. "Ascii" 
  1075.    sets the file transfer type to ASCII (flat text). 
  1076.  
  1077.  
  1078. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpSetBinary() ΓòÉΓòÉΓòÉ
  1079.  
  1080. Set error codes 
  1081.  
  1082.  
  1083. ΓòÉΓòÉΓòÉ 4.20. FtpSetUser() ΓòÉΓòÉΓòÉ
  1084.  
  1085. Select an item: 
  1086.  
  1087.  Syntax 
  1088.  Parameters 
  1089.  Return Values 
  1090.  Definition 
  1091.  Related Calls 
  1092.  
  1093.  
  1094. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpSetUser() ΓòÉΓòÉΓòÉ
  1095.  
  1096. /* Identifies the host, user ID,
  1097.    password, and account for the
  1098.    remote host                   */
  1099.  
  1100. rc = FtpSetUser(host,userid,password<,account>)
  1101.  
  1102.  
  1103. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpSetUser() ΓòÉΓòÉΓòÉ
  1104.  
  1105. The FtpSetUser() call sets the host, user ID, and password for the remote host. 
  1106. Most other REXX FTP API calls require a host, user ID, and password to be set. 
  1107.  
  1108. Optionally, the FtpSetUser() call sets the user's account. 
  1109.  
  1110. The host, userid, password, and account are retained during the life of the 
  1111. process.  If you are using the REXX FTP API package within a .CMD file run the 
  1112. OS/2 prompt, this means the life of the CMD.EXE process. 
  1113.  
  1114. You may want to 'blank' out the password (at least) when you are finished, to 
  1115. prevent unauthorized access to a host you previously used.  The FtpLogoff() 
  1116. function also resets these values. 
  1117.  
  1118.  
  1119. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpSetUser() ΓòÉΓòÉΓòÉ
  1120.  
  1121. host 
  1122.    name of the remote host to which you want to connect. 
  1123.  
  1124. userid 
  1125.    identifies you to the FTP server. 
  1126.  
  1127. password 
  1128.    supplies a password to the remote host. 
  1129.  
  1130. account 
  1131.    supplies host-dependent account information. 
  1132.  
  1133.  
  1134. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpSetUser() ΓòÉΓòÉΓòÉ
  1135.  
  1136. Set error codes 
  1137.  
  1138.  
  1139. ΓòÉΓòÉΓòÉ 4.21. FtpSite() ΓòÉΓòÉΓòÉ
  1140.  
  1141. Select an item: 
  1142.  
  1143.  Syntax 
  1144.  Parameters 
  1145.  Return Values 
  1146.  Definition 
  1147.  Related Calls 
  1148.  
  1149.  
  1150. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpSite() ΓòÉΓòÉΓòÉ
  1151.  
  1152. /* Sends site information to the
  1153.    remote host                     */
  1154.  
  1155. rc = FtpSite(site)
  1156.  
  1157.  
  1158. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpSite() ΓòÉΓòÉΓòÉ
  1159.  
  1160. The FtpSite() call sends information to the remote host.  Your server must 
  1161. support the FTP information sent by the FtpSite() call. 
  1162.  
  1163. The remote host is specified with the FtpSetUser() call. 
  1164.  
  1165.  
  1166. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpSite() ΓòÉΓòÉΓòÉ
  1167.  
  1168. site 
  1169.    the string that is sent to the remote host to provide services specific to 
  1170.    the remote host. 
  1171.  
  1172.  
  1173. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpSite() ΓòÉΓòÉΓòÉ
  1174.  
  1175. FTP error codes 
  1176.  
  1177.  
  1178. ΓòÉΓòÉΓòÉ 4.22. FtpSys() ΓòÉΓòÉΓòÉ
  1179.  
  1180. Select an item: 
  1181.  
  1182.  Syntax 
  1183.  Parameters 
  1184.  Return Values 
  1185.  Definition 
  1186.  Related Calls 
  1187.  
  1188.  
  1189. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpSys() ΓòÉΓòÉΓòÉ
  1190.  
  1191. /* Returns the name of the operating
  1192.    system that the server is running */
  1193.  
  1194. rc = FtpSys(operSys)
  1195.  
  1196.  
  1197. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpSys() ΓòÉΓòÉΓòÉ
  1198.  
  1199. The FtpSys() call returns the FTP server description of the operating system 
  1200. running on the remote host. 
  1201.  
  1202. The remote host is specified with the FtpSetUser() call. 
  1203.  
  1204.  
  1205. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpSite() ΓòÉΓòÉΓòÉ
  1206.  
  1207. operSys 
  1208.    the FTP server description of the operating system running on the remote 
  1209.    host. 
  1210.  
  1211.  
  1212. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpSys() ΓòÉΓòÉΓòÉ
  1213.  
  1214. FTP error codes 
  1215.  
  1216.  
  1217. ΓòÉΓòÉΓòÉ 4.23. FtpVersion() ΓòÉΓòÉΓòÉ
  1218.  
  1219. Select an item: 
  1220.  
  1221.  Syntax 
  1222.  Parameters 
  1223.  Return Values 
  1224.  Definition 
  1225.  Related Calls 
  1226.  
  1227.  
  1228. ΓòÉΓòÉΓòÉ <hidden> Syntax for FtpVersion() ΓòÉΓòÉΓòÉ
  1229.  
  1230. /* Identifies the version of the
  1231.    REXX FTP API package          */
  1232.  
  1233. rc = FtpVersion(variable)
  1234.  
  1235.  
  1236. ΓòÉΓòÉΓòÉ <hidden> Definition for FtpVersion() ΓòÉΓòÉΓòÉ
  1237.  
  1238. The FtpVersion() call identifies the version of the REXX FTP API package.  The 
  1239. current version is 2.0. 
  1240.  
  1241.  
  1242. ΓòÉΓòÉΓòÉ <hidden> Parameters for FtpVersion() ΓòÉΓòÉΓòÉ
  1243.  
  1244. variable 
  1245.    returns the version of REXX FTP API program that you are running. 
  1246.  
  1247.  
  1248. ΓòÉΓòÉΓòÉ <hidden> Return Values for FtpVersion() ΓòÉΓòÉΓòÉ
  1249.  
  1250. The version number is returned in the variable that you pass in the function. 
  1251. The actual return code can be ignored.